home *** CD-ROM | disk | FTP | other *** search
/ Alles Voor Internet / Tout Pour Internet / alles voor internet.iso / MacInternet™ / Net / Utilities / Seer family 2.0 / docs / unloved files / seer_interface.p < prev    next >
Encoding:
Text File  |  1987-08-29  |  4.6 KB  |  125 lines  |  [TEXT/PJMM]

  1. {seer_interface.p - interface file for using the 'seer' code resource}
  2. {    to read AppleTalk packets permisciously }
  3. UNIT seer_interface;
  4. INTERFACE
  5.     CONST
  6.         PAK_SIZE = 610;        {maximum suported packet size}
  7.         SEER_MAJOR = 2;    {major_version we where built with}
  8.         SEER_MINOR = 1;        {minor_version we where built with}
  9.  
  10.     TYPE
  11.  
  12. {    seer status structure.}
  13. {    A pointer to this is returned by the SRr_load call.}
  14. {    Following these defined fields are seers private data.}
  15. {    These may be accessed for debugging purposes by examining}
  16. {    seer_private.h for the format.}
  17.         SR_status_ty = (            {seer status information}
  18.             SR_status_off,            {packet recording is off}
  19.             SR_status_on,            {packet recording is on}
  20.             SR_status_dfull,         {recording was on, but data queue filled up}
  21.             SR_status_hfull);         {recording was on, but header queue filled up}
  22.         SR_status = RECORD
  23.                 status : SR_status_ty;    {[out] current status}
  24.                 pre_pak_num : longint;     {[out] packet number of packet before current}
  25.                 h_inuse : longint;        {[out] number of header slots in use}
  26.                 h_size : longint;        {[out] number of header slots}
  27.                 d_inuse : longint;        {[out] number of data bytes in use}
  28.             END;
  29.         SR_status_pt = ^SR_status;
  30.  
  31.     {the argument block to a pointer to a routine}
  32.     {Call the routine after loading}
  33.     {and locking the 'seer' code resource.  If it is ever unlocked}
  34.     {then call SRa_load again.}
  35.         SRa_load = RECORD
  36.                 major_version : integer;        {[in]}
  37.                 minor_version : integer;        {[out]}
  38.         {******************************************************}
  39.         {  If there is a there is a major version mismatch and}
  40.         {  SRe_badver is returned, fields below here are unchanged.}
  41.         {*****************************************************}
  42.                 status_pt : SR_status_pt;    {[out] seer status}
  43.                 header_length : integer;        {[out] bytes per packet header}
  44.                 data_overhead : integer;        {[out] overhead per packet in data queue}
  45.             END;
  46.  
  47. {arguments for SRp_initq}
  48.         SRa_initq = RECORD
  49.                 dbufstart : Ptr;        {[in] start of data buffer}
  50.                 dbuflen : longint;        {[in] length of data buffer}
  51.                 hbufstart : Ptr;        {[in] start of header buffer}
  52.                 hbuflen : longint;        {[in] length of header buffer}
  53.             END;
  54.  
  55.         pak_err_ty = (            {the kinds of errors a packet can have}
  56.             PE_none,                {the packet didn't overrun, had an abort, good crc}
  57.             PE_overrun,            {the recieve data interupt routine missed some data}
  58.             PE_noabort,                {the packet did not end with an abort flag}
  59.             PE_badcrc);                {the packet had an incorrect hardware crc}
  60.  
  61. {data passed to/from SRr_getpak}
  62.         SRa_getpak = RECORD
  63.                 pak_num : longint;    {[in] the number of the desired packet}
  64.                 pak_data : Ptr;        {[out] a pointer to the packets data or NIL}
  65.                 pak_time : longint;    {[out] when the packet came in (not yet implimented)}
  66.                 pak_err : pak_err_ty;    {[out] what error occured on this packet}
  67.                 pak_size : integer;    {[out] how big the packet is}
  68.             END;
  69.  
  70. { Note : opcode - 1 is used by the device manager to signal the goodbye kiss .}
  71. { We accept a goodbye kiss and turn off interupts and restore the interupt vectors}
  72. {if needed }
  73.         SR_opcode_ty = (        {commands supported by seer}
  74.             SRc_unused,            {unused, reserved}
  75.             SRc_killio,                {killio does this control entry to stop io}
  76.             SRc_load,                 {seer has just been loaded, bind absalute addresses}
  77.             SRc_initq,                {setup data and header queues}
  78.             SRc_off,                 {stop collecting data}
  79.             SRc_on,                 {start collecting data}
  80.             SRc_getpak,            {return a packet}
  81.             SRc_release,             {release the storage used by a packet}
  82.             SRc_clear_queue);         {empty the queue}
  83.  
  84.         SRe_error_ty = (    {seer error status return codes}
  85.             SRe_noErr,        {success, no error}
  86.             SRe_badver,    {the version of seer you said you wanted to SRr_load isn't available}
  87.             SRe_never,     {the packet number you asked SRr_getpak for has already been released}
  88.             SRe_notyet);     {the packet number you asked SRr_getpak for hasn't arrived yet}
  89.  
  90.         SR_record = RECORD
  91.                 SRe_error : SRe_error_ty;
  92.                 SR_user : longint;
  93.                 CASE SR_opcode_ty OF
  94.                     SRc_load : (
  95.                             a_load : SRa_load
  96.                     );
  97.                     SRc_initq : (
  98.                             a_initq : SRa_initq
  99.                     );
  100.                     SRc_off : (
  101.                     );
  102.  
  103.                     SRc_on : (
  104.                     );
  105.                     SRc_getpak : (
  106.                             a_getpak : SRa_getpak
  107.                     );
  108.                     SRc_release : (
  109.                     );
  110.                     SRc_clear_queue : (
  111.                     );
  112.             END;
  113.         SR_record_pt = ^SR_record;
  114.  
  115.     {this representation works for c but I think it does not work for pascal,}
  116.     {I have been using the Control call instead of PBControl so I don't know yet}
  117.         SR_iorecord = RECORD
  118.                 io_cp : ParamBlockRec;            {our operation is in csCode in here}
  119.                 io_SR : SR_record_pt;            {may be longer than 22 bytes, point to control record}
  120.                 SR_dummy : ARRAY[0..8] OF integer;    {pad up to the 22 bytes}
  121.             END;
  122.  
  123. IMPLEMENTATION
  124.  
  125. END.